import request from '@/utils/request';
import surveyRequest from '@/utils/request-survey';

// 获取规则列表
export const getRulesList = (params) => {
  return request({
    url: '/points/rules',
    method: 'GET',
    params
  });
};

// 创建规则
export const createRules = (data) => {
  return request({
    url: '/points/rules',
    method: 'POST',
    data
  });
};

// 更新规则
export const updateRules = (id, data) => {
  return request({
    url: `/points/rules/${id}`,
    method: 'PUT',
    data
  });
};

// 获取问卷和测试列表
export const getSurveyList = () => {
  return surveyRequest({
    url: '/survey/getList',
    method: 'GET',
    params: {
      curPage: 1,
      pageSize: 9999999,
    }
  });
};

